package com.h2.config;

import com.h2.entity.Role;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @Author: TongRui乀
 * @Date: 2020/9/19 14:38
 * @description：
 */
@RestController
public class TestController {

    @GetMapping("get")
    public Role get(){

        Role role = new Role();

        role.setId(1);
        role.setCreateTime(new Date());
        role.setName("Jack");
        return role;
    }


    @PostMapping("add")
    public Role add(Role role){
        System.out.println(role.getId());
        return role;
    }


}
